using System;
using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;

namespace Caramel.ServiceModel.Castle
{
	public class ServiceModelInstaller : IWindsorInstaller
	{
		#region IWindsorInstaller Members

		public void Install(IWindsorContainer container, IConfigurationStore store)
		{
			container.
				Register(
					Component.
						For<ILocalStorage>().
						ImplementedBy<PerCallLocalStorage>().
						LifeStyle.
						Singleton,
					Component.
						For(typeof(ServiceLocatorInstanceProvider<>)).
						ImplementedBy(typeof(ServiceLocatorInstanceProvider<>))
				);
		}

		#endregion
	}
}
